@jay-framework/aiditor 0.17.3 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/actions/check-add-page-route.jay-action +12 -0
- package/dist/actions/check-add-page-route.jay-action.d.ts +10 -0
- package/dist/actions/check-page-add-page-brief.jay-action +9 -0
- package/dist/actions/check-page-add-page-brief.jay-action.d.ts +8 -0
- package/dist/actions/check-plugin-update.jay-action +14 -0
- package/dist/actions/check-plugin-update.jay-action.d.ts +13 -0
- package/dist/actions/ensure-project-plugin.jay-action +9 -0
- package/dist/actions/ensure-project-plugin.jay-action.d.ts +8 -0
- package/dist/actions/generate-add-page-brief-from-image.jay-action +20 -0
- package/dist/actions/generate-add-page-brief-from-image.jay-action.d.ts +20 -0
- package/dist/actions/get-plugin-setup-status.jay-action +9 -0
- package/dist/actions/get-plugin-setup-status.jay-action.d.ts +6 -0
- package/dist/actions/list-jay-plugins.jay-action +8 -0
- package/dist/actions/list-jay-plugins.jay-action.d.ts +5 -0
- package/dist/actions/list-plugin-contracts.jay-action +11 -0
- package/dist/actions/list-plugin-contracts.jay-action.d.ts +9 -0
- package/dist/actions/open-add-page-from-brief.jay-action +20 -0
- package/dist/actions/open-add-page-from-brief.jay-action.d.ts +18 -0
- package/dist/actions/reclassify-add-page-asset.jay-action +12 -0
- package/dist/actions/reclassify-add-page-asset.jay-action.d.ts +10 -0
- package/dist/actions/rerun-plugin-setup.jay-action +12 -0
- package/dist/actions/rerun-plugin-setup.jay-action.d.ts +10 -0
- package/dist/actions/save-add-page-draft.jay-action +10 -0
- package/dist/actions/save-add-page-draft.jay-action.d.ts +9 -0
- package/dist/actions/start-add-page-request.jay-action +12 -0
- package/dist/actions/start-add-page-request.jay-action.d.ts +10 -0
- package/dist/actions/submit-add-page.jay-action +21 -0
- package/dist/actions/submit-add-page.jay-action.d.ts +17 -0
- package/dist/actions/submit-task.jay-action +1 -0
- package/dist/actions/submit-task.jay-action.d.ts +1 -0
- package/dist/actions/sync-add-page-plugin-manifest.jay-action +11 -0
- package/dist/actions/sync-add-page-plugin-manifest.jay-action.d.ts +9 -0
- package/dist/actions/upload-add-page-asset.jay-action +13 -0
- package/dist/actions/upload-add-page-asset.jay-action.d.ts +13 -0
- package/dist/actions/write-plugin-source.jay-action +13 -0
- package/dist/actions/write-plugin-source.jay-action.d.ts +12 -0
- package/dist/add-page-agent/SKILL.md +79 -0
- package/dist/add-page-agent/system.md +47 -0
- package/dist/index.client.js +2696 -278
- package/dist/index.d.ts +797 -6
- package/dist/index.js +2682 -14
- package/dist/pages/aiditor/page.jay-html +603 -2
- package/dist/prompts/add-page-figma-brief-prompt.md +163 -0
- package/dist/prompts/add-page-figma-design-definitions-prompt.md +256 -0
- package/dist/prompts/add-page-figma-design-from-image-prompt.md +144 -0
- package/package.json +24 -7
- package/plugin.yaml +34 -0
package/README.md
CHANGED
|
@@ -23,11 +23,7 @@ The plugin auto-registers with the Jay dev server — no additional configuratio
|
|
|
23
23
|
|
|
24
24
|
## Requirements
|
|
25
25
|
|
|
26
|
-
The AI agent runs server-side via the Claude Agent SDK.
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
export ANTHROPIC_API_KEY=sk-ant-...
|
|
30
|
-
```
|
|
26
|
+
The AI agent runs server-side via the Claude Agent SDK (`query()`). Authentication matches Claude Code — set `ANTHROPIC_API_KEY` or run `claude login`.
|
|
31
27
|
|
|
32
28
|
## Usage
|
|
33
29
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: checkAddPageRouteAction
|
|
2
|
+
description: Validate and normalize an Add Page route; check if it already exists
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
pageRoute: string
|
|
6
|
+
|
|
7
|
+
outputSchema:
|
|
8
|
+
normalizedRoute: string
|
|
9
|
+
routeKind: static | dynamic
|
|
10
|
+
routeExists: boolean
|
|
11
|
+
valid: boolean
|
|
12
|
+
error?: string
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: checkPluginUpdateAction
|
|
2
|
+
description: Compare installed plugin version with latest on npm
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
pluginName: string
|
|
6
|
+
|
|
7
|
+
outputSchema:
|
|
8
|
+
pluginName: string
|
|
9
|
+
packageName: string
|
|
10
|
+
installedVersion?: string
|
|
11
|
+
latestVersion?: string
|
|
12
|
+
updateAvailable: boolean
|
|
13
|
+
isLocalSource: boolean
|
|
14
|
+
message?: string
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CheckPluginUpdateActionInput {
|
|
2
|
+
pluginName: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface CheckPluginUpdateActionOutput {
|
|
6
|
+
pluginName: string;
|
|
7
|
+
packageName: string;
|
|
8
|
+
installedVersion?: string;
|
|
9
|
+
latestVersion?: string;
|
|
10
|
+
updateAvailable: boolean;
|
|
11
|
+
isLocalSource: boolean;
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: generateAddPageBriefFromImageAction
|
|
2
|
+
description: Generate Add Page Content or Design markdown from screenshot(s) via vision AI
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
target: content | design
|
|
6
|
+
requestId?: string
|
|
7
|
+
pageRoute?: string
|
|
8
|
+
contextNotes?: string
|
|
9
|
+
extraFiles?: record(file)
|
|
10
|
+
|
|
11
|
+
outputSchema:
|
|
12
|
+
ok: boolean
|
|
13
|
+
markdown?: string
|
|
14
|
+
suggestedRoute?: string
|
|
15
|
+
suggestedRouteKind?: static | dynamic
|
|
16
|
+
referenceAttachments?:
|
|
17
|
+
- id: string
|
|
18
|
+
path: string
|
|
19
|
+
filename: string
|
|
20
|
+
error?: string
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JayFile } from '@jay-framework/fullstack-component';
|
|
2
|
+
|
|
3
|
+
export interface GenerateAddPageBriefFromImageActionInput {
|
|
4
|
+
requestId?: string;
|
|
5
|
+
pageRoute?: string;
|
|
6
|
+
contextNotes?: string;
|
|
7
|
+
extraFiles?: Record<string, JayFile>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface GenerateAddPageBriefFromImageActionOutput {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
markdown?: string;
|
|
13
|
+
suggestedRoute?: string;
|
|
14
|
+
referenceAttachments?: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
path: string;
|
|
17
|
+
filename: string;
|
|
18
|
+
}>;
|
|
19
|
+
error?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: openAddPageFromBriefAction
|
|
2
|
+
description: Load a page's saved Add Page brief into a new page request with a unique copy route
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
jayHtmlPath: string
|
|
6
|
+
sourcePageRoute: string
|
|
7
|
+
|
|
8
|
+
outputSchema:
|
|
9
|
+
ok: boolean
|
|
10
|
+
error?: string
|
|
11
|
+
requestId?: string
|
|
12
|
+
pageRoute?: string
|
|
13
|
+
routeKind?: static | dynamic
|
|
14
|
+
contentMd?: string
|
|
15
|
+
designMd?: string
|
|
16
|
+
attachments?:
|
|
17
|
+
- id: string
|
|
18
|
+
path: string
|
|
19
|
+
role: reference | asset
|
|
20
|
+
filename: string
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface OpenAddPageFromBriefActionInput {
|
|
2
|
+
jayHtmlPath: string;
|
|
3
|
+
sourcePageRoute: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface OpenAddPageFromBriefActionOutput {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
error?: string;
|
|
9
|
+
requestId?: string;
|
|
10
|
+
pageRoute?: string;
|
|
11
|
+
contentMd?: string;
|
|
12
|
+
designMd?: string;
|
|
13
|
+
attachments?: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
path: string;
|
|
16
|
+
filename: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: reclassifyAddPageAssetAction
|
|
2
|
+
description: Move an attachment between references/ and assets/ for an Add Page request
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
requestId: string
|
|
6
|
+
attachmentId: string
|
|
7
|
+
newRole: reference | asset
|
|
8
|
+
|
|
9
|
+
outputSchema:
|
|
10
|
+
ok: boolean
|
|
11
|
+
path: string
|
|
12
|
+
markdownRef?: string
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: startAddPageRequestAction
|
|
2
|
+
description: Mint an Add Page request folder under .aiditor/page-requests/
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
pageRoute: string
|
|
6
|
+
routeKind?: static | dynamic
|
|
7
|
+
|
|
8
|
+
outputSchema:
|
|
9
|
+
requestId: string
|
|
10
|
+
requestDir: string
|
|
11
|
+
routeExists: boolean
|
|
12
|
+
routeExistsMessage?: string
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: submitAddPageAction
|
|
2
|
+
description: Run the Add Page implementation agent and validate the result (streaming)
|
|
3
|
+
|
|
4
|
+
streaming: true
|
|
5
|
+
|
|
6
|
+
inputSchema:
|
|
7
|
+
requestId: string
|
|
8
|
+
contentMd: string
|
|
9
|
+
designMd: string
|
|
10
|
+
pageRoute: string
|
|
11
|
+
routeKind?: static | dynamic
|
|
12
|
+
isRetry?: boolean
|
|
13
|
+
|
|
14
|
+
outputSchema:
|
|
15
|
+
type: string
|
|
16
|
+
message?: string
|
|
17
|
+
text?: string
|
|
18
|
+
name?: string
|
|
19
|
+
result?: string
|
|
20
|
+
filePath?: string
|
|
21
|
+
validateErrors?: string[]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface SubmitAddPageActionInput {
|
|
2
|
+
requestId: string;
|
|
3
|
+
contentMd: string;
|
|
4
|
+
designMd: string;
|
|
5
|
+
pageRoute: string;
|
|
6
|
+
isRetry?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SubmitAddPageActionOutput {
|
|
10
|
+
type: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
text?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
result?: string;
|
|
15
|
+
filePath?: string;
|
|
16
|
+
validateErrors?: Array<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: uploadAddPageAssetAction
|
|
2
|
+
description: Upload a reference or asset file for an Add Page request
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
requestId: string
|
|
6
|
+
role: reference | asset
|
|
7
|
+
file: file
|
|
8
|
+
|
|
9
|
+
outputSchema:
|
|
10
|
+
id: string
|
|
11
|
+
path: string
|
|
12
|
+
markdownRef: string
|
|
13
|
+
markdownSnippet?: string
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JayFile } from '@jay-framework/fullstack-component';
|
|
2
|
+
|
|
3
|
+
export interface UploadAddPageAssetActionInput {
|
|
4
|
+
requestId: string;
|
|
5
|
+
file: JayFile;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface UploadAddPageAssetActionOutput {
|
|
9
|
+
id: string;
|
|
10
|
+
path: string;
|
|
11
|
+
markdownRef: string;
|
|
12
|
+
markdownSnippet?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: writePluginSourceAction
|
|
2
|
+
description: Add or update a local plugin source in .aiditor/plugin-sources.yaml
|
|
3
|
+
|
|
4
|
+
inputSchema:
|
|
5
|
+
pluginName: string
|
|
6
|
+
packageName: string
|
|
7
|
+
installSpec: string
|
|
8
|
+
label?: string
|
|
9
|
+
kind?: string
|
|
10
|
+
description?: string
|
|
11
|
+
|
|
12
|
+
outputSchema:
|
|
13
|
+
ok: boolean
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Add Page — implementation steps
|
|
2
|
+
|
|
3
|
+
Follow these steps in order when creating a Jay Stack page from an Add Page brief.
|
|
4
|
+
|
|
5
|
+
## 1. Read the brief
|
|
6
|
+
|
|
7
|
+
1. Read `content.md` — behavior, plugins, contracts, copy, interactions.
|
|
8
|
+
2. Read `design.md` — layout, typography, colors, spacing, responsive behavior.
|
|
9
|
+
3. List files in `references/` and `assets/` under the request folder.
|
|
10
|
+
|
|
11
|
+
## 2. Map route → page path
|
|
12
|
+
|
|
13
|
+
Jay uses directory-based routing under `src/pages/`:
|
|
14
|
+
|
|
15
|
+
| Route | Page directory |
|
|
16
|
+
| ------------------------ | ----------------------------------------------- |
|
|
17
|
+
| `/` | `src/pages/page.jay-html` |
|
|
18
|
+
| `/about` | `src/pages/about/page.jay-html` |
|
|
19
|
+
| `/products/[slug]` | `src/pages/products/[slug]/page.jay-html` |
|
|
20
|
+
| `/products/[[category]]` | `src/pages/products/[[category]]/page.jay-html` |
|
|
21
|
+
|
|
22
|
+
Dynamic segment names must match contract `params` (e.g. `slug`, `category`, `prefix`).
|
|
23
|
+
|
|
24
|
+
For static routes that use a dynamic contract, add:
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<script type="application/jay-params">
|
|
28
|
+
slug: my-product-slug
|
|
29
|
+
</script>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 3. Discover contracts
|
|
33
|
+
|
|
34
|
+
1. Read `agent-kit/plugins-index.yaml` for installed plugins and contract paths.
|
|
35
|
+
2. Read each selected contract's `.jay-contract` file — note `params`, tag types, phases, and refs.
|
|
36
|
+
3. Consult `agent-kit/designer/routing.md`, `jay-html-syntax.md`, and `contracts-and-plugins.md` as needed.
|
|
37
|
+
|
|
38
|
+
## 4. Scaffold the page
|
|
39
|
+
|
|
40
|
+
Create `page.jay-html` (and `page.ts` / `page.jay-contract` only if the brief requires custom page logic).
|
|
41
|
+
|
|
42
|
+
Minimum headless import:
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<script
|
|
46
|
+
type="application/jay-headless"
|
|
47
|
+
plugin="@jay-framework/wix-stores"
|
|
48
|
+
contract="product-page"
|
|
49
|
+
key="product"
|
|
50
|
+
></script>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use the plugin manifest from the user message for exact `plugin`, `contract`, and `key` values.
|
|
54
|
+
|
|
55
|
+
## 5. Bind data and interactions
|
|
56
|
+
|
|
57
|
+
- Data: `{contractKey.fieldName}` in text and attributes.
|
|
58
|
+
- Conditionals: `<div if="condition">` — use `===` not `==`.
|
|
59
|
+
- Loops: `<div forEach="items" trackBy="id">`.
|
|
60
|
+
- Interactions: `ref="contractKey.refName"` on the target element.
|
|
61
|
+
|
|
62
|
+
Read contract tags before binding — do not invent field names.
|
|
63
|
+
|
|
64
|
+
## 6. Apply design
|
|
65
|
+
|
|
66
|
+
- Match `design.md` for layout, colors, typography, and breakpoints.
|
|
67
|
+
- Reuse patterns from existing pages (header, footer, nav) when requested.
|
|
68
|
+
- Use `references/*` for spacing and composition inspiration only.
|
|
69
|
+
|
|
70
|
+
## 7. Copy assets
|
|
71
|
+
|
|
72
|
+
When `content.md` or `design.md` cites an asset file:
|
|
73
|
+
|
|
74
|
+
1. Copy from the request folder's `assets/` into the project (`public/` or an appropriate path).
|
|
75
|
+
2. Reference the copied path in the page (e.g. `src="/images/hero.png"`).
|
|
76
|
+
|
|
77
|
+
## 8. Finish
|
|
78
|
+
|
|
79
|
+
Summarize files created, how they satisfy the brief, and any blockers. Do not run `jay-stack validate` — the server validates after the agent completes.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
You are a Jay Stack page author working inside an existing Jay project.
|
|
2
|
+
|
|
3
|
+
Your job is to create **one** page at the route given in the user message. Match the user's intent from their brief files as closely as possible.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
- Create or fix page files for **this route only** — do not refactor unrelated pages.
|
|
8
|
+
- Read `content.md` and `design.md` in the request folder before writing code.
|
|
9
|
+
- Follow `agent-kit/designer/INSTRUCTIONS.md` and `agent-kit/developer/INSTRUCTIONS.md` in the project.
|
|
10
|
+
- Reuse existing site patterns (header, footer, typography, spacing) from other pages when the brief asks for consistency.
|
|
11
|
+
|
|
12
|
+
## Headless components
|
|
13
|
+
|
|
14
|
+
When the user message includes a plugin manifest table:
|
|
15
|
+
|
|
16
|
+
- Add `<script type="application/jay-headless" plugin="..." contract="..." key="...">` for each entry.
|
|
17
|
+
- Bind UI using contract ViewState fields and refs per agent-kit designer guides.
|
|
18
|
+
- Read the materialized `.jay-contract` files listed in `agent-kit/plugins-index.yaml` before binding.
|
|
19
|
+
|
|
20
|
+
If Wix or other plugin config is incomplete, still implement layout and headless imports. Live store data may be unavailable until config files are filled.
|
|
21
|
+
|
|
22
|
+
## Attachments
|
|
23
|
+
|
|
24
|
+
- `references/*` — inspiration only; do not copy verbatim unless the brief says so.
|
|
25
|
+
- `assets/*` — copy cited assets from the request folder into appropriate project paths (`public/`, etc.) when implementing.
|
|
26
|
+
|
|
27
|
+
## Dynamic routes
|
|
28
|
+
|
|
29
|
+
- Map route segments to directory names under `src/pages/` per Jay routing conventions.
|
|
30
|
+
- For static override routes (no dynamic segment), declare params with `<script type="application/jay-params">` (YAML body).
|
|
31
|
+
- Use `jay-params` when a headless contract requires params that are not in the URL path.
|
|
32
|
+
|
|
33
|
+
## Validation
|
|
34
|
+
|
|
35
|
+
Do **not** run `jay-stack validate` yourself — the server runs validation after you finish.
|
|
36
|
+
|
|
37
|
+
## Retry mode
|
|
38
|
+
|
|
39
|
+
If the user message says retry mode, read existing page files at the route and **fix** issues rather than recreating from scratch.
|
|
40
|
+
|
|
41
|
+
## Output
|
|
42
|
+
|
|
43
|
+
When done, summarize:
|
|
44
|
+
|
|
45
|
+
1. Files created or modified
|
|
46
|
+
2. How the implementation covers the brief
|
|
47
|
+
3. Any assumptions or blockers (missing config, ambiguous design, etc.)
|